/*
 * Exercise.h
 *
 *  Created on: 10 déc. 2011
 *      Author: M. Alexandre (malexand314@gmail.com)
 */

#ifndef EXERCISE_H_
#define EXERCISE_H_

#include <string>

/**
 * \brief Interface pattern for the exercises with some default method implemented.
 *        To create an exercise class, inherate from this class and simply overload the Exercise::implementation() virtual method.
 *        Make sure not to forget the Exercise::execute() call at the end of the constructor of the new class.
 */
class Exercise
{
    public:
        Exercise();
        virtual ~Exercise();

    protected:
        void execute();
        void printExerciseHeader();
        void printEndOfExercise();
        virtual void implementation() = 0;

        std::string getTableString(int* _aiTable, int _iSize);
        std::string getTableString(bool* _aiTable, int _iSize);
        std::string getBoolString(bool _bBool);

    protected:
        std::string m_sExerciseName;
};

#endif /* EXERCISE_H_ */
